package chenji.gunapi.gun;

import java.util.ArrayList;

import org.bukkit.Material;
import org.bukkit.entity.Arrow;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

import chenji.gunapi.GunAPI;
import chenji.gunapi.bullet.accuracy.BulletAccuracy;
import chenji.gunapi.gun.Gun;
import chenji.gunapi.gun.ReloadHandler;
import chenji.gunapi.gun.Sight;
import chenji.gunapi.gun.SoundHandler;

public class M4A1 implements Gun {
	public M4A1() {
		GunAPI.getGunAPI().getGunManager().addGun(this);
	}

	@Override
	public int getDamage() {
		return 5;
	}

	@Override
	public int getShootSpeed() {
		return 3444;
	}

	@Override
	public String getName() {
		return "M4A1";
	}

	@Override
	public ItemStack getItemStack() {
		ItemStack i = new ItemStack(Material.DIAMOND_PICKAXE);
		ItemMeta m = i.getItemMeta();
		m.setDisplayName("§cM4A1");
		ArrayList<String> l = new ArrayList<String>();
		l.add("§c测试用枪");
		l.add("我知道你认为他就是个镐子，但是，他确实是一把枪");
		m.setLore(l);
		i.setItemMeta(m);
		return i;
	}

	@Override
	public int getFullBulletAmount() {
		return 30;
	}

	@Override
	public void reload() {
		// TODO Auto-generated method stub

	}

	@Override
	public boolean isKnockBack() {
		return false;
	}

	@Override
	public Arrow makeBullet(Arrow bullet) {
		return bullet;
	}

	@Override
	public BulletAccuracy getAccuracy() {
		return null;
	}

	@Override
	public Arrow setAccuracy(Arrow bullet, int amount, boolean ismoving) {
		return bullet;
	}

	@Override
	public boolean autoShoot() {
		return false;
	}

	@Override
	public boolean canSights() {
		return false;
	}

	@Override
	public Sight getSights() {
		return null;
	}

	@Override
	public ReloadHandler getReloadHandler() {
		return new ReloadHandler(50, 2, 50, 35);
	}

	@Override
	public int getAlreadShootAmount(long time) {
		return (int) time;
	}

	@Override
	public SoundHandler getSoundHandler() {
		return new SoundHandler("cs.weapons.reload", "cs.weapons.reload", "cs.weapons.carbine");
	}

}
